/* 表格数据项类型 */
interface CardItem {
  id: number
  personName: string
  phoneNumber: string
  carNumber: string
  carBrand: string
  cardStatus: number
  totalEffectiveDate: number
}

/* 搜索表单数据类型 */
interface SearchForm {
  carNumber: string
  personName: string
  cardStatus: number | ""
}

/* 分页参数类型 */
interface Page {
  page: number
  pageSize: number
  total?: number
}
type SearchParams = SearchForm & Page
/* 新增表单数据类型 */
interface AddForm {
  personName: string
  phoneNumber: string
  carNumber: string
  carBrand: string
  cardStartDate: string
  cardEndDate: string
  paymentAmount: string
  paymentMethod: "Alipay" | "WeChat" | "Cash"
  rechargeId?: number
  rechargeList?: Array<{ rechargeId: number, [key: string]: any }>
}
interface RechargeForm {
  cardStartDate: string
  cardEndDate: string
  paymentAmount: string
  paymentMethod: "Alipay" | "WeChat" | "Cash"
  carInfoId: number
}
/* 状态下拉选项类型 */
interface StatusOpts {
  label: string
  value: number
}

/* API 响应类型 */
interface ApiResponse<T = any> {
  data: T
  message?: string
  code?: number
}

/* 分页响应类型 */
interface PageResponse<T> {
  data: {
    rows: T[]
    total: number
  }
}

export type { AddForm, ApiResponse, CardItem, Page, PageResponse, RechargeForm, SearchForm, SearchParams, StatusOpts }
